OCAMLC=ocamlc

all: bin/texcaml doc/texcaml.ml.pdf

bin/texcaml:
	$(OCAMLC) -I +camlp4 dynlink.cma camlp4lib.cma src/texcaml.ml -o bin/texcaml

src/texcaml.ml.tex: bin/texcaml src/texcaml.ml
	bin/texcaml src/texcaml.ml

doc/texcaml.ml.pdf: src/texcaml.ml.tex
	cd doc && pdftex ../src/texcaml.ml.tex

doc/texcaml.ml.dvi: src/texcaml.ml.tex
	cd doc && tex ../src/texcaml.ml.tex

clean:
	rm -f bin/* doc/* src/*.cmi src/*.cmo src/texcaml.ml.tex
